home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / MacApp / MacApp 3.0a2 / CPlusIncludes / Graf3D.h < prev    next >
Text File  |  1991-05-01  |  2KB  |  107 lines

  1. /************************************************************
  2.  
  3. Created: Monday, January 7, 1991 at 6:00 AM
  4.     Graf3D.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.    1985-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __GRAF3D__
  15. #define __GRAF3D__
  16.  
  17. #ifndef __GEOMETRY__
  18. #include <Geometry.h>
  19. #endif
  20.  
  21. #ifndef __QUICKDRAW__
  22. #include <Quickdraw.h>
  23. #endif
  24.  
  25.  
  26. enum {
  27.  
  28.     radConst = 3754936
  29. };
  30.  
  31. typedef Fixed XfMatrix[4][4]; 
  32.  
  33. struct Point3D {
  34.     Fixed x;
  35.     Fixed y;
  36.     Fixed z;
  37. };
  38.  
  39. typedef struct Point3D Point3D;
  40.  
  41. struct Point2D {
  42.     Fixed x;
  43.     Fixed y;
  44. };
  45.  
  46. typedef struct Point2D Point2D;
  47.  
  48. struct Port3D {
  49.     GrafPtr grPort;
  50.     Rect viewRect;
  51.     Fixed xLeft;
  52.     Fixed yTop;
  53.     Fixed xRight;
  54.     Fixed yBottom;
  55.     Point3D pen;
  56.     Point3D penPrime;
  57.     Point3D eye;
  58.     Fixed hSize;
  59.     Fixed vSize;
  60.     Fixed hCenter;
  61.     Fixed vCenter;
  62.     Fixed xCotan;
  63.     Fixed yCotan;
  64.     char filler;
  65.     char ident;
  66.     XfMatrix xForm;
  67. };
  68.  
  69. typedef Port3D *Port3DPtr, **Port3DHandle;
  70.  
  71.  
  72. #ifdef __cplusplus
  73. extern "C" {
  74. #endif
  75. pascal void InitGrf3d(Port3DHandle port); 
  76. pascal void Open3DPort(Port3DPtr port); 
  77. pascal void SetPort3D(Port3DPtr port); 
  78. pascal void GetPort3D(Port3DPtr& port); 
  79. pascal void MoveTo2D(Fixed x,Fixed y); 
  80. pascal void MoveTo3D(Fixed x,Fixed y,Fixed z); 
  81. pascal void LineTo2D(Fixed x,Fixed y); 
  82. pascal void Move2D(Fixed dx,Fixed dy); 
  83. pascal void Move3D(Fixed dx,Fixed dy,Fixed dz); 
  84. pascal void Line2D(Fixed dx,Fixed dy); 
  85. pascal void Line3D(Fixed dx,Fixed dy,Fixed dz); 
  86. pascal void ViewPort(const Rect& r); 
  87. pascal void LookAt(Fixed left,Fixed top,Fixed right,Fixed bottom); 
  88. pascal void ViewAngle(Fixed angle); 
  89. pascal void Identity(void); 
  90. pascal void Scale(Fixed xFactor,Fixed yFactor,Fixed zFactor); 
  91. pascal void Translate(Fixed dx,Fixed dy,Fixed dz); 
  92. pascal void Pitch(Fixed xAngle); 
  93. pascal void Yaw(Fixed yAngle); 
  94. pascal void Roll(Fixed zAngle); 
  95. pascal void Skew(Fixed zAngle); 
  96. pascal void Transform(const Point3D& src,Point3D& dst); 
  97. pascal short Clip3D(const Point3D& src1,const Point3D& src2,Point& dst1,
  98.     Point& dst2); 
  99. pascal void SetPt3D(Point3D& pt3D,Fixed x,Fixed y,Fixed z); 
  100. pascal void SetPt2D(Point2D& pt2D,Fixed x,Fixed y); 
  101. pascal void LineTo3D(Fixed x,Fixed y,Fixed z); 
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105.  
  106. #endif
  107.